package org.jeecg.modules.util;

import org.jeecg.modules.entity.DiyProfessorInfo;
import org.jeecg.modules.temporary.entity.DiyTemporaryApplicantInfo;

/**
 * @author 王鹏
 * @version 1.0
 * @description   单独封装一个对临时申请人提交的数据进行保存到数据库的类方法
 * @date 2020/9/1 18:36
 */
public class SaveDiyTemporaryApplicantInfo {
    public static DiyTemporaryApplicantInfo saveDiyTemporaryApplicantInfo(DiyProfessorInfo diyProfessorInfo , String userid){
        DiyTemporaryApplicantInfo diyTemporaryApplicantInfo=new DiyTemporaryApplicantInfo();
        diyTemporaryApplicantInfo.setId(diyProfessorInfo.getId());
        diyTemporaryApplicantInfo.setDingUserId(userid);
        diyTemporaryApplicantInfo.setProfessorApproveMsg(diyProfessorInfo.getProfessorApproveMsg());
        diyTemporaryApplicantInfo.setProfessorTitle(diyProfessorInfo.getProfessorTitle());
        diyTemporaryApplicantInfo.setProfessorName(diyProfessorInfo.getProfessorName());
        diyTemporaryApplicantInfo.setProfessorSex(diyProfessorInfo.getProfessorSex());
        diyTemporaryApplicantInfo.setProfessorSchool(diyProfessorInfo.getProfessorSchool());
        diyTemporaryApplicantInfo.setProfessorMajor(diyProfessorInfo.getProfessorMajor());
        diyTemporaryApplicantInfo.setProfessorBirthday(diyProfessorInfo.getProfessorBirthday());
        diyTemporaryApplicantInfo.setProfessorEducationBackground(diyProfessorInfo.getProfessorEducationBackground());
        diyTemporaryApplicantInfo.setProfessorGraduateDate(diyProfessorInfo.getProfessorGraduateDate());
        diyTemporaryApplicantInfo.setProfessorDegree(diyProfessorInfo.getProfessorDegree());
        diyTemporaryApplicantInfo.setProfessorWorkUnit(diyProfessorInfo.getProfessorWorkUnit());
        diyTemporaryApplicantInfo.setProfessorAddress(diyProfessorInfo.getProfessorAddress());
        diyTemporaryApplicantInfo.setProfessorDeclareCategory(diyProfessorInfo.getProfessorDeclareCategory());
        diyTemporaryApplicantInfo.setProfessorPosition(diyProfessorInfo.getProfessorPosition());
        diyTemporaryApplicantInfo.setProfessorBeginWork(diyProfessorInfo.getProfessorBeginWork());
        diyTemporaryApplicantInfo.setProfessorWorkMajor(diyProfessorInfo.getProfessorWorkMajor());
        diyTemporaryApplicantInfo.setProfessorMajorDate(diyProfessorInfo.getProfessorMajorDate());
        diyTemporaryApplicantInfo.setProfessorIdentity(diyProfessorInfo.getProfessorIdentity());
        diyTemporaryApplicantInfo.setProfessorHomeAddress(diyProfessorInfo.getProfessorHomeAddress());
        diyTemporaryApplicantInfo.setProfessorHealth(diyProfessorInfo.getProfessorHealth());
        diyTemporaryApplicantInfo.setProfessorOfficeTel(diyProfessorInfo.getProfessorOfficeTel());
        diyTemporaryApplicantInfo.setProfessorPhone(diyProfessorInfo.getProfessorPhone());
        diyTemporaryApplicantInfo.setProfessorHomeAddress(diyProfessorInfo.getProfessorProjectIntroduce());
        diyTemporaryApplicantInfo.setProfessorLeadMsg(diyProfessorInfo.getProfessorLeadMsg());
        diyTemporaryApplicantInfo.setCreateBy(diyProfessorInfo.getCreateBy());
        diyTemporaryApplicantInfo.setUpdateBy(diyProfessorInfo.getUpdateBy());
        diyTemporaryApplicantInfo.setUpdateTime(diyProfessorInfo.getUpdateTime());
        diyTemporaryApplicantInfo.setProfessorHomeAddress(diyProfessorInfo.getProfessorHomeAddress());
        String photo="";
        if(diyProfessorInfo.getProfessorPhoto()==null){
            photo=null;
        }else {
            byte[] photoString = diyProfessorInfo.getProfessorPhoto();
            photo = new String(photoString);
            diyTemporaryApplicantInfo.setProfessorPhotoString(photo);
        }
        return diyTemporaryApplicantInfo;
    }
}
